import axios from "axios";

const request = axios.create({
    baseURL:'http://127.0.0.1:3000'
})

request.interceptors.request.use(
    config => {
        const token = localStorage.getItem('token'); // 假设 Token 存储在 localStorage 中  
        if (token) {  
            // 如果 Token 存在，则添加到请求头中  
            config.headers.token = token
        }
        return config  
    },
    error => {
        return console.log('1');
        
    }
)

export default request